This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2000-192893, filed Jun. 27, 2000, the entire contents of which are incorporated herein by reference.
1. Field of the Invention
The present invention relates to an electronic apparatus for storing data which must be protected even in power outage in a volatile memory such as a RAM, and a method for protecting data in this electronic apparatus.
2. Description of the Related Art
In an electronic apparatus such as multi-function peripherals (MFP), a DRAM has been conventionally often used in order to store data. When data to be stored in the DRAM must be protected even in power outage, a sub power supply using a battery is provided as well as a main power supply. When electric power supply from the main power supply is stopped, data stored in the DRAM is protected by the electric power supply from this sub power supply.
However, when backup is effected by using the battery in this manner, the state with the electric power supply from the main power supply being stopped lasts for a long time, and hence the data stored in the DRAM is lost when the battery is completely discharged.
In order to protect the data stored in the DRAM for a long period of time, increase in capacity of the battery can be considered. However, the battery with the large capacity leads to increase in size and price. Further, granting that the capacity is large, the capacity is limited, and the data can not be assuredly prevented from being lost.
Use of a non-volatile memory such as a flash memory instead of the DRAM can be also considered. However, the operating speed of the non-volatile memory is generally lower than that of the DRAM. Therefore, when the non-volatile memory is used, the speed of various operations involving the memory access is lowered.
U.S. Pat. No. 5,396,637 discloses the technique of storing data from a RAM into a hard disk drive when the supply of power from the power supply is stopped. The technique ensures the protection of the data.
In view of cost benefit, however, such a large apparatus as a disk drive should not be used only to save the data stored in the RAM. Additionally, a large battery must be used to drive a disk drive, which consumes much power. In view of this, too, a disk drive should not be used.
It is an object of the present invention to hold data even if electric power supply from a main power supply is stopped while a volatile memory holds the data in normal operation.
The above-mentioned object of the present invention in attained by an electronic apparatus comprising: a volatile first memory; a main power supply configured to supply electric power to the first memory; a sub power supply configured to supply electric power to the first memory when the main power supply is stopped; a non-volatile second memory configured to store an operation program of the processor; a data transferring section configured to store in the second memory predetermined specific data stored in the first memory in response to start of electric power supply from the sub power supply; and a supply stopping section configured to stop electric power supply from the sub power supply in response to completion of storing the specific data in the second memory by the data transferring section.
Further, the above-mentioned object of the present invention in attained also by a data protection method comprising: a step of storing in a non-volatile second memory which stores an operation program of predetermined processor, predetermined specific data stored in the first memory in response to start of electric power supply from the sub power supply; and a step of stopping electric power supply from the sub power supply in response to completion of storing the specific data in the second memory.
Additional objects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objects and advantages of the invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out hereinafter.